import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import FrontView from '@/views/FrontView.vue'
import LoginRegisterView from '@/views/LoginRegisterView.vue'
import LawyerListView from '@/views/LawyerListView.vue'
import ConsultationListView from '@/views/ConsultationListView.vue'
import ConsultationDetailView from '@/views/ConsultationDetailView.vue'
import ChatView from '@/views/ChatView.vue'
import ConsultationCreateView from '@/views/ConsultationCreateView.vue'
import LawyerAppointmentView from '@/views/LawyerAppointmentView.vue'
import TemplateView from '@/views/TemplateView.vue'
import DocumentTemplateView from '@/views/DocumentTemplateView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/home',
    },
    {
      path: '/login',
      component: LoginRegisterView,
    },
    {
      path: '/home',
      component: HomeView,
      children: [
        {
          path: '',
          name: 'home',
          component: FrontView,
        },
        {
          path: '/lawyers',
          component: LawyerListView,
        },
        {
          path: '/appointment',
          name: 'LawyerAppointment',
          component: LawyerAppointmentView,
        },
        {
          path: '/consultation',
          component: ConsultationListView,
        },
        {
          path: '/consultation/:id',
          component: ConsultationDetailView,
        },
        {
          path: '/consultation/:id/chat',
          component: ChatView,
        },
        {
          path: '/consultation/create',
          component: ConsultationCreateView,
        },
        {
          path: '/template',
          component: TemplateView,
        },
        {
          path: '/document-templates',
          name: 'DocumentTemplates',
          component: DocumentTemplateView,
        },
      ],
    },
  ],
})

export default router
